package com.example.statemachine.machine.state;

import com.example.statemachine.machine.base.FsmResBody;
import com.example.statemachine.machine.base.FsmState;
import com.example.statemachine.machine.base.FsmStateService;
import org.springframework.context.annotation.Configuration;

/**
 * @author jianwei.wang
 * @version v1.0
 * @date 2019/5/9 11:21
 **/
@Configuration
public class AntiReviewStateService extends FsmState {

    private FsmStateService fsmStateService;

    @Override
    public FsmResBody cancel() {
        fsmStateService.cancel(this.getT());
        return FsmResBody.success();
    }

    @Override
    public FsmResBody submit() {
        fsmStateService.submit(this.getT());
        return FsmResBody.success();
    }

    @Override
    public FsmResBody review() {
        fsmStateService.review(this.getT());
        return FsmResBody.success();
    }

    public AntiReviewStateService(FsmStateService fsmStateService) {
        this.fsmStateService = fsmStateService;
    }
}
